package com.mycompany.app.hr.security.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "s_delegation")
@SuppressWarnings("unused")
public class SystemDelegation {

    private Long delegationId;

    private String source;

    private String target;

    private Date startDate;

    private Date endDate;

    private Date withdrawDate;

    private Boolean isWithdraw;

    private String withdrawReason;

    @OneToMany()
    private Set<SystemPermission> perms = new HashSet<SystemPermission>(0);

    // ========================================================

    @Override
    public String toString() {

        return ToStringBuilder.reflectionToString(this,
                ToStringStyle.SHORT_PREFIX_STYLE);
    }

    // ========================================================

}
